package com.example.person_web.core.controller;

import com.example.person_web.common.WrapperResponse;
import com.example.person_web.core.dto.WebSiteDTO;
import com.example.person_web.core.service.WebSiteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/core/web/website")
public class WebSiteController {
    @Autowired
    private WebSiteService webSiteService;

    @GetMapping("/query")
    public WrapperResponse queryWebSite() {
        return webSiteService.queryWebSite();
    }

    @PostMapping("/add")
    public WrapperResponse addWebSite(@RequestBody WebSiteDTO webSiteDTO) {
        return webSiteService.addWebSite(webSiteDTO);
    }

    @PostMapping("/delete")
    public WrapperResponse deleteWebSite(@RequestBody WebSiteDTO webSiteDTO) {
        return webSiteService.deleteWebSite(webSiteDTO);
    }
}
